package org.javaboy.servletlinsterfilter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

@WebFilter
public class MyFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("进入filter");
        // 执行下一个过滤器或者业务代码
        filterChain.doFilter(servletRequest,servletResponse);
        // 执行完毕后可以继续执行还会经过这个过滤器
    }

    @Override
    public void destroy() {

    }
}
